Skip to content

test(sql): run test postgres natively without docker#4715

Merged
sveitser merged 9 commits into
mainfrom
ma/tests-sans-docker
Jul 20, 2026
Merged

test(sql): run test postgres natively without docker#4715
sveitser merged 9 commits into
mainfrom
ma/tests-sans-docker

Conversation

@sveitser

Copy link
Copy Markdown
Collaborator

TmpDb spawned a docker run postgres container. Replace it with a native initdb + postgres server on a reserved TCP port, connecting as the postgres superuser to the default postgres database over trust auth (same surface the docker image exposed). Shutdown uses pg_ctl stop -m fast with a SIGKILL fallback; the datadir is removed on Drop.

CI: add an install-postgres composite action (server binaries onto PATH) and wire it into test-postgres, slowtest and coverage; reuse it from install-native-demo-deps. Add install-foundry to coverage.

doc/ubuntu.md: install the postgresql server instead of docker, and reduce the executed section to a compile check plus a single migration smoke test.

sveitser added 8 commits July 17, 2026 14:37
Replace the five Docker-backed process-compose services with native
processes so `just demo-native` needs no Docker daemon:

- demo-l1-network: custom geth-l1 image -> native anvil (from foundry)
- espresso-node-db-0/1: docker postgres -> scripts/run-postgres
- keydb: docker keydb -> native redis-server
- telemetry-collector (vector) and block-explorer: dropped

flake.nix adds redis and bumps postgresql_16 -> postgresql_18.
cleanup-process-compose drops the docker compose teardown and reaps
anvil/postgres/redis-server.
- run-postgres: break readiness loop on shutdown signal so a SIGTERM
  during startup does not spin (pg_isready never succeeds against a
  shutting-down server); skip createdb when shutting down
- run-postgres: correct DATADIR docs (initdb creates the dir)
- bind anvil and redis to 127.0.0.1 instead of all interfaces
The native demo previously ran the L1, CDN store, and node DBs as Docker
containers, so the test-integration and demo-native jobs only needed
process-compose. Now those run natively (anvil, redis-server, postgres),
which were absent on the runner and broke every native demo job with
'anvil: command not found'.

Add install-native-demo-deps: installs foundry (anvil), redis-server and
postgresql, stops the auto-started redis/postgres services so the demo can
bind its own ports, and puts the postgres server binaries on PATH.
The Push-CDN broker heartbeat uses KeyDB's EXPIREMEMBER command, which plain
redis does not implement, so brokers never registered and the CDN was dead
(the demo limped along on the libp2p secondary; the non-PoS->PoS epoch upgrade
tests stalled). The standalone cdn-broker/cdn-marshal pick their discovery
client at compile time (Redis), so SQLite/embedded discovery is not selectable.

KeyDB is not in nixpkgs and has no clean macOS build, so nix/keydb.nix
repackages prebuilt binaries: the official keydb-tools .deb relocated via
autoPatchelfHook on Linux, and the Homebrew bottle (openssl relocated + re-signed)
on macOS aarch64. CI extracts the .deb directly.
autoPatchelfHook failed on the keydb-tools .deb for libbz2.so.1.0, liblz4.so.1,
libz.so.1 and libsystemd.so.0, which broke the default nix devShell build and
every nix-develop CI job (contracts, etc.). Add the full DT_NEEDED set.
TmpDb spawned a `docker run postgres` container. Replace it with a native
`initdb` + `postgres` server on a reserved TCP port, connecting as the
`postgres` superuser to the default `postgres` database over trust auth (same
surface the docker image exposed). Shutdown uses `pg_ctl stop -m fast` with a
SIGKILL fallback; the datadir is removed on Drop.

CI: add an install-postgres composite action (server binaries onto PATH) and
wire it into test-postgres, slowtest and coverage; reuse it from
install-native-demo-deps. Add install-foundry to coverage.

doc/ubuntu.md: install the postgresql server instead of docker, and reduce the
executed section to a compile check plus a single migration smoke test.
@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Base automatically changed from ma/native-demo-no-docker to main July 20, 2026 08:57
@sveitser
sveitser marked this pull request as ready for review July 20, 2026 09:31
# Conflicts:
#	.github/actions/install-native-demo-deps/action.yml
@sveitser
sveitser enabled auto-merge (squash) July 20, 2026 09:39
@sveitser
sveitser merged commit 46f05f2 into main Jul 20, 2026
143 checks passed
@sveitser
sveitser deleted the ma/tests-sans-docker branch July 20, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants